import RequestBase from '@/utils/request';
import config from '@/config';

const baseRequest = new RequestBase(config.education);

// 获取考试列表
export const getPaperList = (data) => {
	return baseRequest.get('/resource/paper/list', data);
}

// 获取试卷详情
export const getPaperDetail = (id) => {
	return baseRequest.get(`/resource/paper/${id}`)
}

// 开始考试
export const startSimulationTest = (data) => {
	return baseRequest.post('/plan/simulation-exam/start', data)
}

//模拟考试详情
export const getSimulationTestDetail = (id) => {
	return baseRequest.get(`/plan/simulation-exam/${id}`)
}

//模拟考试提交单个题目
export const submitOneExam = (id, data) => {
	return baseRequest.put(`/plan/simulation-exam/${id}/submit-question-single`, data)
}

//提交考试
export const submitExam = (id) => {
	return baseRequest.put(`/plan/simulation-exam/${id}/submit-exam`)
}

// 模拟考试记录
export const getSimulationTestRecord = (data) => {
	return baseRequest.get('/plan/simulation-exam/list', data)
}
